home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 3.iso / dist / fw_nmh.idb / usr / freeware / bin / sendfiles.z / sendfiles
Text File  |  2001-04-12  |  784b  |  43 lines

  1. #!/bin/sh
  2. #
  3. # $Id: sendfiles,v 1.1.1.1 1999/04/30 18:08:35 doug Exp $
  4. #
  5. # Send multiples files and/or directories as a tar/compressed
  6. # image, in a MIME message.
  7. #
  8.  
  9. DELAY=0
  10. FROM=
  11.  
  12. case "$1" in
  13.     -*)    DELAY="`echo $1 | sed -e 's%-%%'`"
  14.     shift
  15.     ;;
  16. esac
  17.  
  18. if [ ! -z "$PERSON" ]; then
  19.     FROM="-from $PERSON"
  20. fi
  21.  
  22. if [ $# -lt 3 ]; then
  23.     echo 'usage: sendfiles: "mailpath" "subject-string" directory-or-file ...' 1>&2
  24.     exit 1;
  25. fi
  26.  
  27. mailpath="$1"
  28. echo "mailpath = $mailpath" 1>&2
  29. shift
  30.  
  31. subject="$1"
  32. echo "subject-string = $subject" 1>&2
  33. shift
  34.  
  35. echo "files = $*" 1>&2
  36.  
  37. tar cvf - "$@" | compress | \
  38.     viamail -to "$mailpath" -subject "$subject" \
  39.     -parameters "type=tar; x-conversions=compress" \
  40.     -comment "extract with uncompress | tar xvpf -" \
  41.     -delay "$DELAY" \
  42.     -verbose $FROM
  43.